using System.Windows;

namespace Bookvar.ApplicationModel
{
	public class BookvarApplication : Application
	{
		private IBookvarServiceProvider bookvarServiceProvider;

		public IBookvarServiceProvider ServiceLayer
		{
			get
			{
				if ( bookvarServiceProvider == null )
				{
					bookvarServiceProvider = new BookvarServiceProvider();
				}
				return bookvarServiceProvider;
			}
		}

		public new static BookvarApplication Current
		{
			get { return Application.Current as BookvarApplication; }
		}

		public void RunApplication()
		{
			Run();
		}

		public void CloseApplication()
		{
			MainWindow.Close();
		}
	}
}